<template name="views_modals_transactionInfo">
    {{#with transaction}}
        <h1>
            {{i18n "wallet.transactions.transactionInfoTitle"}}
            {{#if $eq ($.Session.get "network") "main"}} 
                <a href="http://etherscan.io/tx/{{transactionHash}}" target="_blank" style="font-size: 0.4em;">{{transactionHash}}</a>
            {{else}}
                {{#if $eq ($.Session.get "network") "rinkeby"}}
                    <a href="http://rinkeby.etherscan.io/tx/{{transactionHash}}" target="_blank" style="font-size: 0.4em;">{{transactionHash}}</a>
                {{else}}
                    {{#if $eq ($.Session.get "network") "ropsten"}}
                        <a href="http://ropsten.etherscan.io/tx/{{transactionHash}}" target="_blank" style="font-size: 0.4em;">{{transactionHash}}</a>
                    {{else}}
                        <span style="font-size: 0.4em;">{{transactionHash}}</span>
                    {{/if}}
                {{/if}}
            {{/if}}

        </h1>

        {{#if outOfGas}}
        <h3 class="orange">
            <i class="icon-shield"></i> {{i18n 'wallet.transactions.outOfGasDesc'}}
        </h3>
        {{/if}}

        <p>
            {{formatTime timestamp "LLLL"}}
            <br>
            <small>({{formatTime timestamp "fromNow"}}{{#if $lt confirmations 10000}}, <strong>{{dapp_formatNumber confirmations "0,0"}}</strong> {{i18n "wallet.transactions.confirmations"}}{{/if}})</small>
        </p>

        <table class="dapp-zebra">
            <!-- <thead>
                
            </thead> -->
            <tbody>
                <tr>
                    <td>{{i18n "wallet.transactions.amount"}}</td>
                    <td>
                       {{#if tokenId}}
                            {{tokenValue}}
                        {{else}}
                            {{formatTransactionBalance value exchangeRates}}
                            {{#if $neq unit 'ether'}}
                                <br>
                                <small>
                                    ({{dapp_formatBalance value "0,0.00[000000] UNIT" "ether"}})
                                </small>
                            {{/if}}
                        {{/if}}
                    </td>
                </tr>
                <tr>
                    <td>{{i18n "wallet.transactions.from"}}</td>
                    <td>
                        {{> elements_account_link address=from}}
                    </td>
                </tr>
                <tr>
                    <td>{{i18n "wallet.transactions.to"}}</td>
                    <td>
                        {{#if to}}
                            {{> elements_account_link address=to}}
                        {{else}}
                            {{> elements_createdContractAt contractAddress=contractAddress deployedData=deployedData}}
                        {{/if}}
                    </td>
                </tr>
                <tr>
                    <td>{{i18n "wallet.transactions.feePaid"}}</td>
                    <td>{{formatTransactionBalance fee exchangeRates}}</td>
                </tr>
                <tr>
                    <td>{{i18n "wallet.transactions.gasUsed"}}</td>
                    <td>{{dapp_formatNumber gasUsed "0,0."}}</td>
                </tr>
                <tr>
                    <td>{{i18n "wallet.transactions.gasPrice"}}</td>
                    <td>{{formatTransactionBalance gasPricePerMillion exchangeRates}} {{i18n "wallet.transactions.perMillionGas"}}</td>
                </tr>
                {{#if blockHash}}
                    <tr>
                        <td>{{i18n "wallet.transactions.block"}}</td>
                        <td>
                           {{#if $eq ($.Session.get "network") "main"}} 
                            <a href="http://etherscan.io/block/{{blockHash}}" title="{{blockHash}}" target="_blank" class="dapp-shorten-text">
                                {{blockNumber}}
                                <br>
                                {{blockHash.substr 0 40}}...
                            </a>
                            {{else}}
                                {{#if $eq ($.Session.get "network") "test"}}
                                <a href="http://ropsten.etherscan.io/block/{{blockHash}}" title="{{blockHash}}" target="_blank" class="dapp-shorten-text">
                                    {{blockNumber}}
                                    <br>
                                    {{blockHash.substr 0 40}}...
                                </a>
                                {{else}}
                                    {{blockNumber}}
                                    <br>
                                    {{blockHash.substr 0 40}}...
                                {{/if}}
                            {{/if}}
                        </td>
                    </tr>
                {{/if}}
                {{#if deployedData}}
                    <tr>
                        <td>{{i18n "wallet.transactions.deployedData"}}</td>
                        <td>
                            <pre>{{deployedData}}</pre>
                        </td>
                    </tr>
                {{/if}}
                {{#if data}}
                    <tr>
                        <td>{{i18n "wallet.transactions.data"}}</td>
                        <td>
                            <pre>{{data}}</pre>
                        </td>
                    </tr>
                {{/if}}
            </tbody>
        </table>
    {{/with}}
</template>